<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCommonSpiderItemsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('common_spider_items', function (Blueprint $table) {
            $table->string("url", 200);
            $table->string("task_no");
            $table->string("type")->default("");
            //
            $table->integer("html_code")->default(0);
            $table->text("html")->default("");
            //
            $table->boolean("is_target")->default(0);
            //
            $table->integer("parse_status")->default(0);
            $table->json("data");
            $table->primary(["url", "task_no"]);
            $table->index(['task_no', "html_code"], "idx_task_no_html_code");
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('common_spider_items');
    }
}
